<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img{
           
            width: 30px;
            height: 30px;
            position: fixed;
            left: 0;
            top: 0;
        
        }
        body{
            height: 2000px;
        }
    </style>
</head>
<body>
    <img src="bg.png" alt="" width="25px">
    <script>
        var img = document.querySelector("img");
        document.onmousemove = function(e){
            var x = e.clientX;
            var y = e.clientY;
            console.log(x,y)
            img.style.left = x+10+"px";
            img.style.top = y+10+"px"
        }
    </script>
</body>
</html>